﻿using System.ComponentModel.DataAnnotations;

namespace Dyao.Book.Contract
{
    /// <summary>
    /// 书籍信息
    /// </summary>
    public class BookInfoDto
    {
        /// <summary>
        /// ID
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Required(ErrorMessage ="书籍名称必填")]
        public string Title { get; set; }

        /// <summary>
        /// 简介
        /// </summary>
        [Required(ErrorMessage = "书籍简介必填")]
        public string Description { get; set; }

        /// <summary>
        /// 作者
        /// </summary>
        [Required(ErrorMessage = "书籍作者必填")]
        public string Author { get; set; }

        /// <summary>
        /// 封面图片
        /// </summary>
        [Required(ErrorMessage = "书籍封面图片必填")]
        public string CoverPicture { get; set; }

        /// <summary>
        /// 分类
        /// </summary>
        [Required(ErrorMessage = "书籍分类必填")]
        public string Category { get; set; }

        /// <summary>
        /// 子分类
        /// </summary>
        [Required(ErrorMessage = "书籍子分类必填")]
        public string SubCategory { get; set; }

        /// <summary>
        /// 爬虫Url
        /// </summary>
        [Required(ErrorMessage = "书籍目录地址必填")]
        public string SpiderUrl { get; set; }

        /// <summary>
        /// 来源类型
        /// </summary>
        [Required(ErrorMessage = "书籍来源类型必填")]
        public BookSourceType SourceType { get; set; }

        /// <summary>
        /// 更新状态
        /// </summary>
        [Required(ErrorMessage = "书籍更新状态必填")]
        public bool Completed { get; set; }
    }
}
